package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysAccountInfoMapper;
import com.ruoyi.system.domain.SysAccountInfo;
import com.ruoyi.system.service.ISysAccountInfoService;

/**
 * 账户信息Service业务层处理
 * 
 * @author zhangjf
 * @date 2025-10-13
 */
@Service
public class SysAccountInfoServiceImpl implements ISysAccountInfoService 
{
    @Autowired
    private SysAccountInfoMapper sysAccountInfoMapper;

    /**
     * 查询账户信息
     * 
     * @param accountId 账户信息主键
     * @return 账户信息
     */
    @Override
    public SysAccountInfo selectSysAccountInfoByAccountId(Long accountId)
    {
        return sysAccountInfoMapper.selectSysAccountInfoByAccountId(accountId);
    }

    /**
     * 查询账户信息列表
     * 
     * @param sysAccountInfo 账户信息
     * @return 账户信息
     */
    @Override
    public List<SysAccountInfo> selectSysAccountInfoList(SysAccountInfo sysAccountInfo)
    {
        return sysAccountInfoMapper.selectSysAccountInfoList(sysAccountInfo);
    }

    /**
     * 新增账户信息
     * 
     * @param sysAccountInfo 账户信息
     * @return 结果
     */
    @Override
    public int insertSysAccountInfo(SysAccountInfo sysAccountInfo)
    {
        sysAccountInfo.setCreateTime(DateUtils.getNowDate());
        return sysAccountInfoMapper.insertSysAccountInfo(sysAccountInfo);
    }

    /**
     * 修改账户信息
     * 
     * @param sysAccountInfo 账户信息
     * @return 结果
     */
    @Override
    public int updateSysAccountInfo(SysAccountInfo sysAccountInfo)
    {
        sysAccountInfo.setUpdateTime(DateUtils.getNowDate());
        return sysAccountInfoMapper.updateSysAccountInfo(sysAccountInfo);
    }

    /**
     * 批量删除账户信息
     * 
     * @param accountIds 需要删除的账户信息主键
     * @return 结果
     */
    @Override
    public int deleteSysAccountInfoByAccountIds(Long[] accountIds)
    {
        return sysAccountInfoMapper.deleteSysAccountInfoByAccountIds(accountIds);
    }

    /**
     * 删除账户信息信息
     * 
     * @param accountId 账户信息主键
     * @return 结果
     */
    @Override
    public int deleteSysAccountInfoByAccountId(Long accountId)
    {
        return sysAccountInfoMapper.deleteSysAccountInfoByAccountId(accountId);
    }

    /**
     *
     * @param sysAccountInfo 修改账户状态
     * @return
     */
    @Override
    public int updateSysAccountStatus(SysAccountInfo sysAccountInfo) {
        return sysAccountInfoMapper.updateSysAccountInfoByStatus(sysAccountInfo);
    }
}
